#ifndef H_EREP_COMMUNICATOR
#define H_EREP_COMMUNICATOR

#include <QtCore/QtCore>
#include <QtGui/QtGui>
#include <QtWebKit/QtWebKit>

namespace erep
{

class Communicator : public QObject
{
    Q_OBJECT
public:
    Communicator( const QString& pathWithArg, QObject* parent=0 );
    virtual ~Communicator();
    
    unsigned int getCount() const { return _count; }
    QNetworkReply* get( const QString& argument );
    QNetworkReply* post( const QString& argument, const QByteArray& data );
    
public slots:
    void recount( QNetworkReply* );
    
signals:
    void readyRead( QNetworkReply* );
    
protected:
    QNetworkAccessManager* _network;
    QString _pathWithArgument;
    unsigned int _count;
};

}

#endif
